﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SimSpike
{
    public partial class frmEditJudges : Form
    {
        public frmEditJudges()
        {
            InitializeComponent();
            cmbBoxNationality.Items.AddRange(Enum.GetNames(typeof(Countries)));

        }

        public string GetCountryString()
        {
            string strCountry = cmbBoxNationality.SelectedItem.ToString();
            strCountry = strCountry.Replace("_", " ");
            return strCountry;
        }

        public string JudgeListString()
        {
            string name = txtBoxName.Text.ToString();
            string nationality = GetCountryString();
            string password = txtBoxPassword.Text.ToString();
            string username = txtBoxUsername.Text.ToString();
            string strOut = string.Format("{0, -45} {1, -45} {2, -25} {3}", name, nationality, username, password);

            return strOut;
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            lstBoxJudges.Items.Add(JudgeListString());
        }

        private void btnDone_Click(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
